package xin.clips.system.service.impl;

import java.util.List;
import xin.clips.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import xin.clips.common.core.text.Convert;
import xin.clips.system.domain.gy.GyMachineParamRecord;
import xin.clips.system.mapper.gy.GyMachineParamRecordMapper;
import xin.clips.system.service.gy.IGyMachineParamRecordService;

/**
 * 机床配置Service业务层处理
 *
 * @author clips
 * @date 2023-03-15
 */
@Service
public class GyMachineParamRecordServiceImpl implements IGyMachineParamRecordService
{
    @Autowired
    private GyMachineParamRecordMapper gyMachineParamRecordMapper;

    /**
     * 查询机床配置
     *
     * @param recordId 机床配置主键
     * @return 机床配置
     */
    @Override
    public GyMachineParamRecord selectGyMachineParamRecordByRecordId(Long recordId)
    {
        return gyMachineParamRecordMapper.selectGyMachineParamRecordByRecordId(recordId);
    }

    /**
     * 查询机床配置列表
     *
     * @param gyMachineParamRecord 机床配置
     * @return 机床配置
     */
    @Override
    public List<GyMachineParamRecord> selectGyMachineParamRecordList(GyMachineParamRecord gyMachineParamRecord)
    {
        return gyMachineParamRecordMapper.selectGyMachineParamRecordList(gyMachineParamRecord);
    }

    /**
     * 新增机床配置
     *
     * @param gyMachineParamRecord 机床配置
     * @return 结果
     */
    @Override
    public int insertGyMachineParamRecord(GyMachineParamRecord gyMachineParamRecord)
    {
        gyMachineParamRecord.setCreateTime(DateUtils.getNowDate());
        return gyMachineParamRecordMapper.insertGyMachineParamRecord(gyMachineParamRecord);
    }

    /**
     * 修改机床配置
     *
     * @param gyMachineParamRecord 机床配置
     * @return 结果
     */
    @Override
    public int updateGyMachineParamRecord(GyMachineParamRecord gyMachineParamRecord)
    {
        gyMachineParamRecord.setUpdateTime(DateUtils.getNowDate());
        return gyMachineParamRecordMapper.updateGyMachineParamRecord(gyMachineParamRecord);
    }

    /**
     * 批量删除机床配置
     *
     * @param recordIds 需要删除的机床配置主键
     * @return 结果
     */
    @Override
    public int deleteGyMachineParamRecordByRecordIds(String recordIds)
    {
        return gyMachineParamRecordMapper.deleteGyMachineParamRecordByRecordIds(Convert.toStrArray(recordIds));
    }

    /**
     * 删除机床配置信息
     *
     * @param recordId 机床配置主键
     * @return 结果
     */
    @Override
    public int deleteGyMachineParamRecordByRecordId(Long recordId)
    {
        return gyMachineParamRecordMapper.deleteGyMachineParamRecordByRecordId(recordId);
    }
}
